<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset=utf8>
</head>
<body>
    <script>
      var str = 'I am cuicui 123456';
      //var reg = new RegExp(/\w{3}/);
      //
      var reg = /\d{6}/;

      console.log(reg);
      console.log(typeof reg);
      console.log(reg.constructor);

      //test() 匹配true/不匹配false
      console.log(reg.test(str));
      console.log(/\w{88}/.tets(str));

      //exec() 匹配true/匹配返回null
      console.log(reg.exec(str));
      console.log(/\w{88}/.exec(str));

      var res = res.exec(str);
      console.log(res.index);
      console.log(res[0]);
      
        
    </script>
</body>
</html>